#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "parsorbase.h"
#include "udpreceivor.h"
#include "wgt_display.h"


//class RefreshTask : public QObject
//{
//    Q_OBJECT

//public:
//    explicit RefreshTask(UdpReceivor* udp_receivor, ParsorBase* parsor,
//                         QObject* parent = 0);
//    ~RefreshTask();
//    void taskStart() {flag_run = true;}
//    void taskStop() {flag_run = false;}
//    bool taskIsRun();

//signals:
//    void signal_UpdateViewArear();


//public slots:
//    void slot_refreshTaskInit();

//    void slot_getRawData();

//private:
//    bool flag_run;
//    UdpReceivor* udp_receivor;
//    ParsorBase* parsor;
//};



namespace Ui {
class MainWindow;
}


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    int RX203_StartSample(QString par_file, int worker_num);

    void StopSample();

private slots:
    void slot_click_btn_sample();
    void slot_click_btn_stop();

    void slot_display_window_close();

    void slot_getRawData();
private:
    QThread* refresh_thread;
    //RefreshTask* worker;
    UdpReceivor* udp_receivor;
    ParsorBase* parsor;
    Wgt_Display* display_window;

    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
